﻿
/*----------------------------------------------------------------//
// 文件名：MoDirFile.cs
// 文件功能描述：实体 MoDirFile.
// 
// 创建标识：Template  ver 5.0.20090429 2009-11-20
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoDirFile
using System;
using System.Data;
namespace EQT.Model
{
    /// <summary>
    /// 业务实体MoDirFile
    /// </summary>
    public partial class MoDirFile : ICloneable
    {
        #region 表DirFile的字段
        private string dfId;
        private string uid;
        private string parentDid;
        private string dfName;
        private string dfFlag;
        private string rem;
        private DateTime createTime;
        #endregion

        #region 构造函数
        public MoDirFile()
        {
            createTime = new DateTime(1900, 1, 1);

        }
        #endregion

        #region 拷贝构造函数

        public MoDirFile(MoDirFile item)
        {
            item.CopyTo(this);
        }
        #endregion

        #region 带参数构造函数
        public MoDirFile(string dfId, string uid, string parentDid, string dfName, string dfFlag, string rem, DateTime createTime)
        {
            this.dfId = dfId;
            this.uid = uid;
            this.parentDid = parentDid;
            this.dfName = dfName;
            this.dfFlag = dfFlag;
            this.rem = rem;
            this.createTime = createTime;
        }
        #endregion

        #region 表DirFile的字段属性
        /// <summary>
        ///目前使用GUID来表达。也可以考虑使用UDF来实现。
        /// </summary>
        public string DfId
        {
            get { return dfId; }
            set { dfId = value; }
        }
        /// <summary>
        /// UID
        /// </summary>
        public string Uid
        {
            get { return uid; }
            set { uid = value; }
        }
        /// <summary>
        ///目前使用GUID来表达。也可以考虑使用UDF来实现。
        /// </summary>
        public string ParentDid
        {
            get { return parentDid; }
            set { parentDid = value; }
        }
        /// <summary>
        ///上传时，本地的文件名称。含扩展名。
        /// </summary>
        public string DfName
        {
            get { return dfName; }
            set { dfName = value; }
        }
        /// <summary>
        ///根，目录，文件
        /// </summary>
        public string DfFlag
        {
            get { return dfFlag; }
            set { dfFlag = value; }
        }
        /// <summary>
        /// REM
        /// </summary>
        public string Rem
        {
            get { return rem; }
            set { rem = value; }
        }
        /// <summary>
        /// CREATE_TIME
        /// </summary>
        public DateTime CreateTime
        {
            get { return createTime; }
            set { createTime = value; }
        }
        #endregion

        #region 辅助函数
        /// <summary>
        /// 拷贝函数
        /// </summary>
        public MoDirFile CopyTo(MoDirFile item)
        {
            item.dfId = this.dfId;
            item.uid = this.uid;
            item.parentDid = this.parentDid;
            item.dfName = this.dfName;
            item.dfFlag = this.dfFlag;
            item.rem = this.rem;
            item.createTime = this.createTime;
            return item;
        }
        /// <summary>
        /// 克隆函数
        /// </summary>		
        public object Clone()
        {
            MoDirFile mo = new MoDirFile();
            mo.DfId = this.DfId;
            mo.Uid = this.Uid;
            mo.ParentDid = this.ParentDid;
            mo.DfName = this.DfName;
            mo.DfFlag = this.DfFlag;
            mo.Rem = this.Rem;
            mo.CreateTime = this.CreateTime;
            return mo;
        }
        ///<summary>
        ///判断对象是否相等
        ///<summary>
        public override bool Equals(object obj)
        {
            if (object.ReferenceEquals(this, obj))
            {
                return true;
            }
            else
            {
                MoDirFile NewDirFile = obj as MoDirFile;
                if (NewDirFile == null)
                {
                    return false;
                }
                else
                {
                    if (NewDirFile.DfId == this.DfId && NewDirFile.Uid == this.Uid && NewDirFile.ParentDid == this.ParentDid && NewDirFile.DfName == this.DfName && NewDirFile.DfFlag == this.DfFlag && NewDirFile.Rem == this.Rem && NewDirFile.CreateTime == this.CreateTime)
                    {
                        return true;
                    }
                }

            }
            return false;

        }
        ///TODO:you should modify GetHashCode by yourself.
        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public override string ToString()
        {
            return String.Format(System.Globalization.CultureInfo.InvariantCulture, "DfId={0}/Uid={1}/ParentDid={2}/DfName={3}/DfFlag={4}/Rem={5}/CreateTime={6}", dfId, uid, parentDid, dfName, dfFlag, rem, createTime);

        }
        #endregion


        #region DataTable Help Function
        ///<summary>
        ///DataRow转换成Model
        ///</summary>
        public void Row2Model(DataRow row)
        {
            if (row["DF_ID"] != null && row["DF_ID"] != DBNull.Value)
            {
                this.DfId = (string)row["DF_ID"];
            }
            else
            {
                this.DfId = string.Empty;
            }
            if (row["UID"] != null && row["UID"] != DBNull.Value)
            {
                this.Uid = (string)row["UID"];
            }
            else
            {
                this.Uid = string.Empty;
            }
            if (row["Parent_DID"] != null && row["Parent_DID"] != DBNull.Value)
            {
                this.ParentDid = (string)row["Parent_DID"];
            }
            else
            {
                this.ParentDid = string.Empty;
            }
            if (row["DF_Name"] != null && row["DF_Name"] != DBNull.Value)
            {
                this.DfName = (string)row["DF_Name"];
            }
            else
            {
                this.DfName = string.Empty;
            }
            if (row["DF_Flag"] != null && row["DF_Flag"] != DBNull.Value)
            {
                this.DfFlag = (string)row["DF_Flag"];
            }
            else
            {
                this.DfFlag = string.Empty;
            }
            if (row["Rem"] != null && row["Rem"] != DBNull.Value)
            {
                this.Rem = (string)row["Rem"];
            }
            else
            {
                this.Rem = string.Empty;
            }
            if (row["Create_Time"] != null && row["Create_Time"] != DBNull.Value)
            {
                this.CreateTime = (DateTime)row["Create_Time"];
            }
            else
            {
                this.CreateTime = DateTime.MinValue;
            }
        }

        ///<summary>
        ///Model转换成DataRow
        ///</summary>
        public void Model2Row(DataRow row)
        {
            row["DF_ID"] = this.DfId;
            row["UID"] = this.Uid;
            row["Parent_DID"] = this.ParentDid;
            row["DF_Name"] = this.DfName;
            row["DF_Flag"] = this.DfFlag;
            row["Rem"] = this.Rem;
            row["Create_Time"] = this.CreateTime;
        }
        #endregion
    }
}
#endregion
